﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Com.JunCaiSoft.ReportCenter.Model
{
    public class ProjectReportItem
    {
        public virtual Guid Id { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public virtual String NumCode { get; set; }
        /// <summary>
        /// 银行名称
        /// </summary>
        public virtual String ProjectName { get; set; }
        /// <summary>
        /// 期初余额
        /// </summary>
        public virtual Double BeginBalance { get; set; }
        /// <summary>
        /// 期末余额
        /// </summary>
        public virtual Double EndBalance
        {
            get
            {
                return Math.Round(BeginBalance + Income - Cost, 2);
            }
        }
        /// <summary>
        /// 期间收入
        /// </summary>
        public virtual Double Income { get; set; }
        /// <summary>
        /// 期间商票收入
        /// </summary>
        public virtual Double IncomeCommercialTicket { get; set; }
        /// <summary>
        /// 期间现金收入
        /// </summary>
        public virtual Double IncomeCash
        {
            get
            {
                return Math.Round(Income - IncomeCommercialTicket, 2);
            }
        }
        /// <summary>
        /// 期间支出
        /// </summary>
        public virtual Double Cost { get; set; }
        /// <summary>
        /// 期间商票支出
        /// </summary>
        public virtual Double CostCommercialTicket { get; set; }
        /// <summary>
        /// 期间现金支出
        /// </summary>
        public virtual Double CostCash
        {
            get
            {
                return Math.Round(Cost - CostCommercialTicket, 2);
            }
        }
        /// <summary>
        /// 期初冻结资金
        /// </summary>
        public virtual Double BeginFreezeMoney { get; set; }
        /// <summary>
        /// 期末冻结资金
        /// </summary>
        public virtual Double EndFreezeMoney { get; set; }
        /// <summary>
        /// 期初可用余额
        /// </summary>
        public virtual Double BeginFlowBalance
        {
            get
            {
                return Math.Round(BeginBalance - BeginFreezeMoney, 2);
            }
        }
        /// <summary>
        /// 期末可用余额
        /// </summary>
        public virtual Double EndFlowBalance
        {
            get
            {
                return Math.Round(EndBalance - EndFreezeMoney, 2);
            }
        }
        /// <summary>
        /// 期初现金余额
        /// </summary>
        public virtual Double BeginCashBalance
        {
            get
            {
                return Math.Round(BeginFlowBalance - BeginCommercialTicket - BeginGongDiFang, 2);
            }
        }
        /// <summary>
        /// 期末现金余额
        /// </summary>
        public virtual Double EndCashBalance
        {
            get
            {
                return Math.Round(EndFlowBalance - EndCommercialTicket - EndGongDiFang, 2);
            }
        }
        /// <summary>
        /// 期初商票
        /// </summary>
        public virtual Double BeginCommercialTicket { get; set; }
        /// <summary>
        /// 期末商票
        /// </summary>
        public virtual Double EndCommercialTicket
        {
            get
            {
                return Math.Round(BeginCommercialTicket + IncomeCommercialTicket - CostCommercialTicket, 2);
            }
        }
        /// <summary>
        /// 期初工抵房
        /// </summary>
        public virtual Double BeginGongDiFang { get; set; }
        /// <summary>
        /// 期末工抵房
        /// </summary>
        public virtual Double EndGongDiFang { get; set; }
        /// <summary>
        /// 关联项目
        /// </summary>
        public virtual List<ProjectReportChildrenItem> children { get; set; }
    }
}
